from itertools import product

column1 = [1, 2, 3, 4]
column2 = ['a', 'b', 'c']

cartesian_product1 = [[(x, y) for x in column1] for y in column2]

for prod_idx in cartesian_product1:
    print(prod_idx)

# 利用 itertools.product() 函数完成笛卡儿积计算
cartesian_product2 = list(product(column1, column2))
print(cartesian_product2)